const express = require('express');
const fs = require("fs");
var app = express();

app.get('/deleteUser:id', function (req, res) {
   fs.readFile( __dirname + "/" + "users.json", 'utf8', function (err, data) {
        data = JSON.parse( data )
        delete data["user" + req.params.id]
        console.log( data )
        res.end( JSON.stringify(data))
   });
})

var server = app.listen(8081,()=> {
  console.log("http://localhost:8081/deleteuser3")
})